New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor context usage #245
Conversation
…lieu of ServiceConsumer
Codecov Report
@@ Coverage Diff @@
## master #245 +/- ##
=========================================
+ Coverage 77% 78.81% +1.8%
=========================================
Files 14 13 -1
Lines 287 269 -18
Branches 58 57 -1
=========================================
- Hits 221 212 -9
+ Misses 49 40 -9
Partials 17 17
Continue to review full report at Codecov.
|
@@ -25,17 +25,17 @@ as bundle splitting and `fusion-react` provides tools to do it easily. | |||
- [Usage](#usage) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The diff on the README is a mess. Summary:
- Add [DEPRECATED] to ProviderPlugin, Provider, ProvidedHOC
- Moved new methods to the top
- Moved deprecated methods to the bottom
- middleware link was dead, removed
- Added API reference for withServices, mysteriously missing
- Document new token parameter for ProvidedHOC.create
- Replace PluginProvider/HOC example with useService example
!merge |
Triggered Fusion.js build verification: https://buildkite.com/uberopensource/fusion-release-verification/builds/2005 |
Provide way to opt-out of legacy context for existing plugin HOCs. This will provide a path forward for existing plugins that use ProviderPlugin/HOC to consume services.
Changes
withServices
to useServiceContext
rather than creating a new ContextReact.createContext
ponyfill fromwithServices
- only use new contexthoc.create
argument to opt out of legacy context, usingServiceContext
insteadTests
Result
By passing the token into
hoc.create
, an HOC can opt out of using legacy context. You can now replacewith
and your component tree will thank you.